package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.User;
import com.ruoyi.system.mapper.UserMapper;
import com.ruoyi.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public String getIdByUsername(String username) {
        String idByUsername = userMapper.getIdByUsername(username);
        return idByUsername;
    }

    @Override
    public boolean checkLogin(User user) {
        boolean b = userMapper.checkLogin(user);
        return b;
    }

    @Override
    public Integer registerUser(User user) {
        Integer integer = userMapper.registerUser(user);
        return integer;
    }

    @Override
    public User info(Integer id) {
        User user = userMapper.info(id);
        return user;
    }

    @Override
    public List<User> getList() {
        List<User> list = userMapper.getList();
        return list;
    }
}
